import config from './config'
export default(url,data={},method='')=>{
  console.log(config.host + url);
    return new Promise((resolve,reject)=>{
        wx.request({
          url:config.host + url,
          method:method,
          data:data,
          header: {
            'content-type': 'application/x-www-form-urlencoded' // 默认值
          },
          success:(data)=>{
            resolve(data)
          },
          fail:(err)=>{
              reject(err)
          }
        })
    })
}